﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsFormsApp1
{
    internal class Weapon
    {
      
            public int X;
            public int Y;
            public bool IsCollected = false;
            private Image WeaponImage;

        public Weapon(int x, int y)
            {
                X = x;
                Y = y;
                WeaponImage = Image.FromFile("gif\\Weapon2.png");
        }

            public void Move()
            {
                Y += 3; // 武器向下移动
            }

            public void Draw(Graphics g)
            {
                g.DrawImage(WeaponImage, X, Y, 40, 40); // 绘制武器
                Move();
            }

            public Rectangle GetRectangle()
            {
                return new Rectangle(X, Y, 40, 40);
            }
        }
    }

